import React from "react";
import PropTypes from "prop-types";

/**
 *  Web Font Component
 */
export default class Font extends React.Component
{
    /**
     * 默认属性
     */
    static defaultProps =
    {
        /*字体类型*/
        type : "fal",
        icon : "",
        class : "",
        style : {}
    };

    /**
     * 属性类型
     */
    static propTypes =
    {
        class : PropTypes.string,
        icon : PropTypes.string.isRequired,
        style : PropTypes.object
    };

    render ()
    {
        return <span className={this.props.class} style={this.props.style}>
            <i className={this.props.type + " fa-" + this.props.icon}>
                {this.props.children}
            </i>
        </span>
    }
}